package com.krain.ddbb.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.krain.corelibrary.widget.AnimCheckBox;
import com.krain.corelibrary.widget.recyleview.BaseRecyclerViewAdapter;
import com.krain.ddbb.R;
import com.krain.ddbb.entity.PersonArdessBean;

import java.util.List;

/**
 * Created by ex-kuangxiaomin101 on 2016-01-13.
 */
public  class UserAddresAdapter extends BaseRecyclerViewAdapter<UserAddresAdapter.ViewHolder>{

    private List<PersonArdessBean> mList;
    private Context context;

    public UserAddresAdapter(List<PersonArdessBean> mList, Context context) {
        this.mList = mList;
        this.context = context;
    }

    public List<PersonArdessBean> getList(){
        return mList;
    }



    @Override
    public ViewHolder getViewHolder(View itemView) {
        return new ViewHolder(itemView);
    }

    @Override
    public View getItemView(int viewType, ViewGroup parent) {
        return  LayoutInflater.from(context).inflate(R.layout.item_addres_list, parent, false);
    }

    @Override
    public Object getItem(int position) {
        return  mList.get(position);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        holder.item_work_type.setText(mList.get(position).getAddress());
       // holder.item_work_checkbox.setEnabled(true);
    }

    @Override
    public int getItemCount() {
        return  mList.size();
    }

    public  class ViewHolder extends RecyclerView.ViewHolder {
        public TextView item_work_type;
      //  public AnimCheckBox item_work_checkbox;

        public ViewHolder(View itemView) {
            super(itemView);
            item_work_type = (TextView)itemView.findViewById(R.id.act_addres_item_tv_type);
          //  item_work_checkbox = (AnimCheckBox)itemView.findViewById(R.id.act_addres_item_checkbox);
        }
    }
}
